﻿myApp.controller('AgentDetailController', function ($scope, $http, $routeParams, $location, $rootScope) {
    $scope.isAndroid = $rootScope.isAndroid;

    pageInit();

    var BASE_URL;
    if ($location.host() == "localhost") {
        BASE_URL = $location.protocol() + "://" + "localhost:" + $location.port();
    } else {
        BASE_URL = $location.protocol() + "://" + $location.host();
    }


    $scope.getShareURL = function (p) {
        //  return (BASE_URL + "/property/" + p.propertyid + "/S" + p.Zoning[0]);
        return (BASE_URL + "/property/" + p.propertyid + "/" + p.SaleType);
    }

    $scope.getShareTitle = function (p) {
        return p.ShortHeading;
    }

    $scope.getShareDescription = function (p) {
        return p.LongHeading;
    }

    $scope.getShareImageURL = function (p) {
        return (p.PropertyURL || "http://www.penangrealty.my/images/penang realty,Apartment,house,condominium,terrace house,semi d,detached,bungalow,high end luxury properties,landed properties,gated guarded house.png");
    }

    $scope.isPropertyTransactSale = function (obj) {
        return obj == 'S' ? true : false;
    }




    $scope.isEmpty = function (obj) {
        for (var i in obj) if (obj.hasOwnProperty(i)) return false;
        return true;
    };


    $scope.sendMessage = function (email) {
        $scope.data = {};
        $scope.data.Email = email;
        $scope.data.Title = $scope.contact_subject;
        $scope.data.Body = $scope.contact_message + "<br/><br/><br/> This message is sent from Shi Jie Property Website:<br/>Name: " + $scope.contact_name + "<br/>Email: " + $scope.contact_email;


        $http.post('/api/User/sendEmail', $scope.data, {
            headers: { 'Content-Type': 'application/json;charset=UTF-8' }
        }).success(function (response) {
            alert("Thanks for submitting, we will contact you soon.");
            $scope.contact_name = "";
            $scope.contact_email = "";
            $scope.contact_subject = "";
            $scope.contact_message = "";
        }).error(function (error) {
            alert("ERROR: " + JSON.stringify(error));
        });

    }

    $scope.submitForm = function (obj) {
        var url = 'https://script.google.com/macros/s/AKfycbwcomu5o2CIbkO1lCjyZhDrF_dejSPWi0VAj9knYKYRr3jHDUY/exec';
        $http({
            method: 'POST',
            url: url,
            data: $(obj.target).serialize(),
            headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
        }).success(function (data) {
            alert("Thanks for Subscribing to our Newsletter!");
            $scope.subscription_email = "";
        });
    }


    function pageInit() {
        if ($routeParams.id) {
            var data = sessionStorage.getItem($routeParams.id);
          //  alert(JSON.stringify(data));
            if (data === null) {
             //   alert("EMPTY!");

                var url = 'api/User/GetAgentDetail/' + $routeParams.id;
                $http.get(url).success(function (data) {
                    console.log("AGENT DETAIL: " + JSON.stringify(data));
                    $scope.agent = data[0];
                    var saleUrl = 'api/Property/Agent/' + data[0].username;
                    var rentUrl = 'api/Property/Agent_Rent/' + data[0].username;

                    $http.get(saleUrl).success(function (data) {
                        console.log("SALE LISTING: " + JSON.stringify(data));
                        $scope.agentSaleListings = data.slice(0, 4);;
                    });

                    $http.get(rentUrl).success(function (data) {
                        console.log("RENT LISTING: " + JSON.stringify(data));
                        $scope.agentRentListings = data.slice(0, 4);;
                    });

                   // if(data[0].Ren == "" || data[0].Ren == null) data[0].Ren = "Ren Not Found"
                    $scope.REN = data[0].Ren;

                }).error(function (err) {
                    alert(JSON.stringify(err));
                });


            } else {
              //  alert("NOT EMPTY!");

                console.log("DATA!!!");
                console.debug("%o", data);

                // if no data in session, get from the server
                jsonObj = JSON.parse(data);
                console.log(JSON.stringify(jsonObj));
                $scope.agent = jsonObj;

                var saleUrl = 'api/Property/Agent/' + jsonObj.username;
                var rentUrl = 'api/Property/Agent_Rent/' + jsonObj.username;

                $http.get(saleUrl).success(function (data) {
                    console.log("SALE LISTING: " + JSON.stringify(data));
                    $scope.agentSaleListings = data.slice(0, 2);;
                })

                $http.get(rentUrl).success(function (data) {
                    console.log("RENT LISTING: " + JSON.stringify(data));
                    $scope.agentRentListings = data.slice(0, 2);;
                })

                $scope.REN = sessionStorage.getItem("ren");
            }

           


        } else {

        }


        //var saleDummy = [{ "propertyid": "b785a676-5dea-4394-8d16-07468cdd4e0f", "Latitude": 5.385385, "Longitude": 100.382085, "road": "PERAI UTAMA 8 LORONG", "location": "PRAI", "state": "PENANG MAINLAND", "type": "CONDO", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_21ac95c41d_o.jpg", "LandSqrtFt": 1050.00, "BuildUp": 1050.00, "Project": "PRAI INAI APARTMENT", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 3, "Bathroom": 2, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "", "Zoning": "Residential", "Furnished": "Furnished", "FurnishedRemark": null, "Renovated": "Renovated", "RenovatedRemark": "80K", "Condition": "", "SRAmt": 280000.00, "SCAmt": null, "SIAmt": null, "SLAmt": null, "SalePrice": 280000.00, "UpdatedDate": "2016-07-28T08:25:22.873", "PropertyURL": "https://farm9.staticflickr.com/8836/28483141435_f1415d4b18.jpg", "LongHeading": "CONDOMINIUM, PRAI INAI APARTMENT", "ShortHeading": "CONDO, PRAI INAI APARTMENT", "SaleType": "SR" }, { "propertyid": "ab7ced4b-6688-4864-b013-07dff4836131", "Latitude": 5.400971, "Longitude": 100.368052, "road": "SELAT JALAN     ", "location": "BUTTERWORTH", "state": "PENANG MAINLAND", "type": "4/S S/OFF C", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_21ac95c41d_o.jpg", "LandSqrtFt": 1440.00, "BuildUp": 6360.00, "Project": "TAMAN SELAT", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 1, "Bathroom": 1, "FloorLoad": null, "Ceiling": null, "BestBuy": 1, "Tenure": "Freehold", "Facing": "", "Zoning": "Commercial", "Furnished": "Not Furnished", "FurnishedRemark": null, "Renovated": "Not Renovated", "RenovatedRemark": null, "Condition": "", "SRAmt": null, "SCAmt": 1300000.00, "SIAmt": null, "SLAmt": null, "SalePrice": 1300000.00, "UpdatedDate": "2016-07-27T09:50:27.807", "PropertyURL": "https://farm2.staticflickr.com/1509/25934267743_89b21fe138.jpg", "LongHeading": "4 STOREY SHOP OFFICE CORNER, TAMAN SELAT", "ShortHeading": "4/S S/OFF C, TAMAN SELAT", "SaleType": "SC" }, { "propertyid": "eab73ab7-806a-41a3-8d30-137a22cf0e8f", "Latitude": 5.422614, "Longitude": 100.395049, "road": "PERUSAHAAN RINGAN 2 LORONG", "location": "BUTTERWORTH", "state": "PENANG MAINLAND", "type": "APT", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_21ac95c41d_o.jpg", "LandSqrtFt": 1210.00, "BuildUp": 1210.00, "Project": "CARISSA PARK", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 4, "Bathroom": 2, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "", "Zoning": "Residential", "Furnished": "Not Furnished", "FurnishedRemark": null, "Renovated": "Partially Renovated", "RenovatedRemark": null, "Condition": "", "SRAmt": 395000.00, "SCAmt": null, "SIAmt": null, "SLAmt": null, "SalePrice": 395000.00, "UpdatedDate": "2016-09-14T13:58:43.057", "PropertyURL": null, "LongHeading": "APARTMENT, CARISSA PARK", "ShortHeading": "APT, CARISSA PARK", "SaleType": "SR" }, { "propertyid": "0ad0df09-ffa8-4cf8-aac9-2545ac24894a", "Latitude": 5.400536, "Longitude": 100.378346, "road": "LIMBUNGAN INDAH JALAN", "location": "BUTTERWORTH", "state": "PENANG MAINLAND", "type": "2/S S/HSE", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_21ac95c41d_o.jpg", "LandSqrtFt": 1400.00, "BuildUp": 1400.00, "Project": "TAMAN LIMBUNGAN INDAH", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 0, "Bathroom": 0, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "", "Zoning": "Commercial", "Furnished": "Not Furnished", "FurnishedRemark": null, "Renovated": "Not Renovated", "RenovatedRemark": null, "Condition": "", "SRAmt": null, "SCAmt": 1100000.00, "SIAmt": null, "SLAmt": null, "SalePrice": 1100000.00, "UpdatedDate": "2016-10-13T12:35:10.4", "PropertyURL": "https://farm9.staticflickr.com/8417/30258456526_8e8eeb858e.jpg", "LongHeading": "DOUBLE-STOREY SHOPHOUSE, TAMAN LIMBUNGAN INDAH", "ShortHeading": "2/S S/HSE, TAMAN LIMBUNGAN INDAH", "SaleType": "SC" }, { "propertyid": "3b76ec5f-3970-4e65-9c1a-2d0bc3de3083", "Latitude": 5.408141, "Longitude": 100.384381, "road": "BAGAN 47 JALAN", "location": "BUTTERWORTH", "state": "PENANG MAINLAND", "type": "2/S S/L TER C", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_21ac95c41d_o.jpg", "LandSqrtFt": 3980.00, "BuildUp": 3800.00, "Project": "TAMAN BAGAN", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 6, "Bathroom": 4, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "", "Zoning": "Residential", "Furnished": "Not Furnished", "FurnishedRemark": null, "Renovated": "Renovated", "RenovatedRemark": null, "Condition": "", "SRAmt": 1400000.00, "SCAmt": null, "SIAmt": null, "SLAmt": null, "SalePrice": 1400000.00, "UpdatedDate": "2016-07-20T17:08:36.063", "PropertyURL": "https://farm9.staticflickr.com/8258/28145235040_6d2f7e567d.jpg", "LongHeading": "DOUBLE STOREY SPLIT LEVEL TERRACE CORNER, TAMAN BAGAN", "ShortHeading": "2/S S/L TER C, TAMAN BAGAN", "SaleType": "SR" }, { "propertyid": "6c59af3b-f3de-4489-9c55-651cd78c36ef", "Latitude": 0.000000, "Longitude": 0.000000, "road": "TUN HUSSEIN ONN JALAN   ", "location": "SEBERANG JAYA", "state": "PENANG MAINLAND", "type": "1/S TER", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_21ac95c41d_o.jpg", "LandSqrtFt": 1400.00, "BuildUp": 1000.00, "Project": "SEBERANG JAYA", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 3, "Bathroom": 2, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Leasehold", "Facing": "", "Zoning": "Residential", "Furnished": "Partially Furnished", "FurnishedRemark": null, "Renovated": "Partially Renovated", "RenovatedRemark": null, "Condition": "", "SRAmt": 350000.00, "SCAmt": null, "SIAmt": null, "SLAmt": null, "SalePrice": 350000.00, "UpdatedDate": "2016-07-12T14:51:23.323", "PropertyURL": null, "LongHeading": "SINGLE STOREY TERRACE, SEBERANG JAYA", "ShortHeading": "1/S TER, SEBERANG JAYA", "SaleType": "SR" }, { "propertyid": "6a73126e-6c2a-4fe1-b379-7b60a8b26280", "Latitude": 0.000000, "Longitude": 0.000000, "road": "KAMPUNG BENGGALI JALAN    ", "location": "BUTTERWORTH", "state": "PENANG MAINLAND", "type": "APT", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_21ac95c41d_o.jpg", "LandSqrtFt": 780.00, "BuildUp": 780.00, "Project": "RIA APARTMENT", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 3, "Bathroom": 2, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "N/A", "Zoning": "Residential", "Furnished": "Furnished", "FurnishedRemark": null, "Renovated": "Renovated", "RenovatedRemark": null, "Condition": "", "SRAmt": 220000.00, "SCAmt": null, "SIAmt": null, "SLAmt": null, "SalePrice": 220000.00, "UpdatedDate": "2016-09-06T16:46:39.217", "PropertyURL": null, "LongHeading": "APARTMENT, RIA APARTMENT", "ShortHeading": "APT, RIA APARTMENT", "SaleType": "SR" }, { "propertyid": "2a1ec983-71a7-4a70-a223-7e6b7d67d46e", "Latitude": 0.000000, "Longitude": 0.000000, "road": "IMPIANA 6 LORONG", "location": "KULIM", "state": "KEDAH", "type": "2/S S/HSE", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_21ac95c41d_o.jpg", "LandSqrtFt": 1400.00, "BuildUp": 1400.00, "Project": "TAMAN LEMBAH IMPIANA", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 0, "Bathroom": 0, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "", "Zoning": "Commercial", "Furnished": "Not Furnished", "FurnishedRemark": null, "Renovated": "Not Renovated", "RenovatedRemark": null, "Condition": "", "SRAmt": null, "SCAmt": 560000.00, "SIAmt": null, "SLAmt": null, "SalePrice": 560000.00, "UpdatedDate": "2016-10-12T16:51:06.24", "PropertyURL": null, "LongHeading": "DOUBLE-STOREY SHOPHOUSE, TAMAN LEMBAH IMPIANA", "ShortHeading": "2/S S/HSE, TAMAN LEMBAH IMPIANA", "SaleType": "SC" }, { "propertyid": "d4b95219-bcf7-4c02-80fb-83b004e263d5", "Latitude": 0.000000, "Longitude": 0.000000, "road": "KOTA KENARI 9/2 LORONG", "location": "KULIM", "state": "KEDAH", "type": "2/S TER C", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_21ac95c41d_o.jpg", "LandSqrtFt": 3920.00, "BuildUp": 3000.00, "Project": "TAMAN KOTA KENARI", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 6, "Bathroom": 3, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "", "Zoning": "Residential", "Furnished": "Not Furnished", "FurnishedRemark": null, "Renovated": "Partially Renovated", "RenovatedRemark": null, "Condition": "", "SRAmt": 390000.00, "SCAmt": null, "SIAmt": null, "SLAmt": null, "SalePrice": 390000.00, "UpdatedDate": "2016-11-15T13:44:06.193", "PropertyURL": null, "LongHeading": "DOUBLE STOREY TERRACE CORNER, TAMAN KOTA KENARI", "ShortHeading": "2/S TER C, TAMAN KOTA KENARI", "SaleType": "SR" }, { "propertyid": "da9f7f96-857f-4495-ad43-9e5008b7d4d4", "Latitude": 5.377671, "Longitude": 100.395358, "road": "HARUAN 2 MEDAN", "location": "PRAI", "state": "PENANG MAINLAND", "type": "1/S TER", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_21ac95c41d_o.jpg", "LandSqrtFt": 1200.00, "BuildUp": 1200.00, "Project": "TAMAN SUPREME", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 3, "Bathroom": 2, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "", "Zoning": "Residential", "Furnished": "Partially Furnished", "FurnishedRemark": null, "Renovated": "Partially Renovated", "RenovatedRemark": null, "Condition": "", "SRAmt": 370000.00, "SCAmt": null, "SIAmt": null, "SLAmt": null, "SalePrice": 370000.00, "UpdatedDate": "2016-07-25T13:56:00.56", "PropertyURL": "https://farm6.staticflickr.com/5634/24033068471_ffa067ffe0.jpg", "LongHeading": "SINGLE STOREY TERRACE, TAMAN SUPREME", "ShortHeading": "1/S TER, TAMAN SUPREME", "SaleType": "SR" }, { "propertyid": "0fbccb1b-0968-4879-8e0f-df7bac75505a", "Latitude": 0.000000, "Longitude": 0.000000, "road": "KAMPUNG BENGGALI LEBUH    ", "location": "BUTTERWORTH", "state": "PENANG MAINLAND", "type": "2/S S/HSE", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_21ac95c41d_o.jpg", "LandSqrtFt": 1400.00, "BuildUp": 1400.00, "Project": "KAMPUNG BENGGALI", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 4, "Bathroom": 3, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "", "Facing": "", "Zoning": "Commercial", "Furnished": "Not Furnished", "FurnishedRemark": null, "Renovated": "Partially Renovated", "RenovatedRemark": null, "Condition": "", "SRAmt": null, "SCAmt": 680000.00, "SIAmt": null, "SLAmt": null, "SalePrice": 680000.00, "UpdatedDate": "2016-10-25T18:20:27.283", "PropertyURL": null, "LongHeading": "DOUBLE-STOREY SHOPHOUSE, KAMPUNG BENGGALI", "ShortHeading": "2/S S/HSE, KAMPUNG BENGGALI", "SaleType": "SC" }, { "propertyid": "78561ea1-bee0-41ca-99b9-fd01d3e5ecf5", "Latitude": 5.414943, "Longitude": 100.379532, "road": "RAJA UDA JALAN", "location": "RAJA UDA", "state": "PENANG MAINLAND", "type": "3/S S/HSE", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_21ac95c41d_o.jpg", "LandSqrtFt": 4200.00, "BuildUp": 4200.00, "Project": "WOLLEY", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 0, "Bathroom": 0, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "", "Zoning": "Commercial", "Furnished": "Not Furnished", "FurnishedRemark": null, "Renovated": "Not Renovated", "RenovatedRemark": null, "Condition": "", "SRAmt": null, "SCAmt": 1500000.00, "SIAmt": null, "SLAmt": null, "SalePrice": 1500000.00, "UpdatedDate": "2016-10-08T12:59:43.257", "PropertyURL": "https://farm4.staticflickr.com/3703/18824019126_4bdecd8585.jpg", "LongHeading": "THREE-STOREY SHOPHOUSE, WOLLEY", "ShortHeading": "3/S S/HSE, WOLLEY", "SaleType": "SC" }];
        //var rentDummy = [{ "propertyid": "e6ed6b22-91c9-43fe-89e8-049dac0a1fa6", "Latitude": 0.000000, "Longitude": 0.000000, "road": "RAJA UDA JALAN", "location": "RAJA UDA", "state": "PENANG MAINLAND", "type": "3/S S/HSE", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_bb79eae979_m.jpg", "LandSqrtFt": 1400.00, "BuildUp": 1400.00, "Project": "WOLLEY", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 1, "Bathroom": 1, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "", "Zoning": "Commercial", "Furnished": "Not Furnished", "FurnishedRemark": null, "Renovated": "Not Renovated", "RenovatedRemark": null, "Condition": "", "RRAmt": null, "RCAmt": 1300.00, "RIAmt": null, "RLAmt": null, "RentPrice": 1300.00, "UpdateDate": "2016-06-24T16:54:16.73", "CreateDate": "2014-01-28T11:38:29.72", "UpdatedDate": "2016-06-24T16:54:16.73", "PropertyURL": null, "LongHeading": "THREE-STOREY SHOPHOUSE, WOLLEY", "ShortHeading": "3/S S/HSE, WOLLEY", "Remark": null, "SaleType": "RC" }, { "propertyid": "5ba4cd9c-9a41-48a4-8351-08fd92094ec6", "Latitude": 0.000000, "Longitude": 0.000000, "road": "RAJA UDA JALAN", "location": "RAJA UDA", "state": "PENANG MAINLAND", "type": "3/S S/HSE", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_bb79eae979_m.jpg", "LandSqrtFt": 1400.00, "BuildUp": 1400.00, "Project": "WOLLEY", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 1, "Bathroom": 1, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "", "Zoning": "Commercial", "Furnished": "Not Furnished", "FurnishedRemark": null, "Renovated": "Not Renovated", "RenovatedRemark": null, "Condition": "", "RRAmt": null, "RCAmt": 3200.00, "RIAmt": null, "RLAmt": null, "RentPrice": 3200.00, "UpdateDate": "2016-06-24T16:52:56.78", "CreateDate": "2014-01-28T11:33:52.46", "UpdatedDate": "2016-06-24T16:52:56.78", "PropertyURL": null, "LongHeading": "THREE-STOREY SHOPHOUSE, WOLLEY", "ShortHeading": "3/S S/HSE, WOLLEY", "Remark": null, "SaleType": "RC" }, { "propertyid": "f5938046-b00a-4280-b991-4e2db3c3fa8f", "Latitude": 0.000000, "Longitude": 0.000000, "road": "TODAK 3 JALAN    ", "location": "SEBERANG JAYA", "state": "PENANG MAINLAND", "type": "3/S S/HSE", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_bb79eae979_m.jpg", "LandSqrtFt": 1400.00, "BuildUp": 1400.00, "Project": "PUSAT BANDAR SUNWAY", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 0, "Bathroom": 0, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "", "Zoning": "", "Furnished": "Not Furnished", "FurnishedRemark": null, "Renovated": "Not Renovated", "RenovatedRemark": null, "Condition": "", "RRAmt": null, "RCAmt": 4200.00, "RIAmt": null, "RLAmt": null, "RentPrice": 4200.00, "UpdateDate": null, "CreateDate": "2016-08-18T15:59:16.473", "UpdatedDate": "2016-08-18T15:59:16.473", "PropertyURL": null, "LongHeading": "THREE-STOREY SHOPHOUSE, PUSAT BANDAR SUNWAY", "ShortHeading": "3/S S/HSE, PUSAT BANDAR SUNWAY", "Remark": null, "SaleType": "RC" }, { "propertyid": "6a73126e-6c2a-4fe1-b379-7b60a8b26280", "Latitude": 0.000000, "Longitude": 0.000000, "road": "KAMPUNG BENGGALI JALAN    ", "location": "BUTTERWORTH", "state": "PENANG MAINLAND", "type": "APT", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_bb79eae979_m.jpg", "LandSqrtFt": 780.00, "BuildUp": 780.00, "Project": "RIA APARTMENT", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 3, "Bathroom": 2, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "N/A", "Zoning": "Residential", "Furnished": "Furnished", "FurnishedRemark": null, "Renovated": "Renovated", "RenovatedRemark": null, "Condition": "", "RRAmt": 680.00, "RCAmt": null, "RIAmt": null, "RLAmt": null, "RentPrice": 680.00, "UpdateDate": "2016-09-06T16:46:39.217", "CreateDate": "2016-09-05T17:46:07.613", "UpdatedDate": "2016-09-06T16:46:39.217", "PropertyURL": null, "LongHeading": "APARTMENT, RIA APARTMENT", "ShortHeading": "APT, RIA APARTMENT", "Remark": null, "SaleType": "RR" }, { "propertyid": "c4a31964-e958-4c6a-ae72-ca3fbd4939b3", "Latitude": 0.000000, "Longitude": 0.000000, "road": "CHAIN FERRY JALAN    ", "location": "BUTTERWORTH", "state": "PENANG MAINLAND", "type": "4/S S/HSE", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_bb79eae979_m.jpg", "LandSqrtFt": 1400.00, "BuildUp": 1400.00, "Project": null, "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 0, "Bathroom": 0, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "", "Zoning": "Commercial", "Furnished": "Not Furnished", "FurnishedRemark": null, "Renovated": "Not Renovated", "RenovatedRemark": null, "Condition": "", "RRAmt": null, "RCAmt": 2000.00, "RIAmt": null, "RLAmt": null, "RentPrice": 2000.00, "UpdateDate": "2016-08-18T13:28:52.357", "CreateDate": "2011-07-13T11:20:55.89", "UpdatedDate": "2016-08-18T13:28:52.357", "PropertyURL": null, "LongHeading": "4-STOREY SHOPHOUSE", "ShortHeading": "4/S S/HSE", "Remark": null, "SaleType": "RC" }, { "propertyid": "46ed3630-3caf-4dfc-ae74-f15d603e7d66", "Latitude": 0.000000, "Longitude": 0.000000, "road": "RAJA UDA JALAN", "location": "RAJA UDA", "state": "PENANG MAINLAND", "type": "3/S S/HSE", "staffid": "d9899bc7-f9b5-4fca-a3b3-e75021ebac77", "agentname": "MONY NG", "mobile": "0124276737", "email": "monyng@lskworld.com", "StaffPicURL": "https://farm4.staticflickr.com/3872/18729593823_bb79eae979_m.jpg", "LandSqrtFt": 1400.00, "BuildUp": 4200.00, "Project": "WOLLEY", "ProjectRemark": null, "Developer": null, "PropertyDesc": null, "Room": 3, "Bathroom": 3, "FloorLoad": null, "Ceiling": null, "BestBuy": 0, "Tenure": "Freehold", "Facing": "", "Zoning": "Commercial", "Furnished": "Not Furnished", "FurnishedRemark": null, "Renovated": "Not Renovated", "RenovatedRemark": null, "Condition": "", "RRAmt": null, "RCAmt": 5500.00, "RIAmt": null, "RLAmt": null, "RentPrice": 5500.00, "UpdateDate": "2016-06-24T16:54:30.753", "CreateDate": "2014-01-28T11:28:36.357", "UpdatedDate": "2016-06-24T16:54:30.753", "PropertyURL": null, "LongHeading": "THREE-STOREY SHOPHOUSE, WOLLEY", "ShortHeading": "3/S S/HSE, WOLLEY", "Remark": null, "SaleType": "RC" }]

        //$scope.newSaleListings = saleDummy;
        //$scope.newRentListings = rentDummy;

        // Agent Rent Listing
        // var url = 'api/Property/Agent_Rent/' + $routeParams.id;




        //var url = 'api/User/GetAgentList';
        //$http.get(url).success(function (data) {
        //    $scope.saerchData = data;
        //    console.log(data);
            
        //    $scope.totalItems = $scope.searchData.length;
        //    $scope.currentPage = 1;
        //    $scope.numPerPage = 10;

        //})
    }

});